/**
 * Created by Administrator on 2018/9/19 0019.
 */
import axios from "axios"

const SITE_URL = 'http://weidong.io/app/r=';
const app_url = (url)=>{
    return SITE_URL+url;
}
export default {
    get(url,callback,error){
        url = app_url(url);
        axios.get(url)
            .then(function (response) {
                callback(response);
            })
            .catch(function (error) {
                error(error);
            })
    },
    post(url,papam,callback,error){
        url = app_url(url);
        axios.post(url, papam)
            .then(function (response) {
                callback(response);
            })
            .catch(function (error) {
                error(error);
            })
    }
}